﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using JTG.ServiceInterface.Model;
using Tzw.Common;

namespace JTG.CheckInMachine
{
    public partial class ShowInfo : BaseForm
    {
        private int _remainTimes = App.GlobSettings.MsgShowTimes;
        public ShowInfo(Enums.ShowStatus showStatus, SignInfo signInfo)
        {
            InitializeComponent();
            lab_time.Text = DateTime.Now.ToString("HH:mm:ss");
            switch (showStatus)
            {
                case Enums.ShowStatus.IsPrintIng:
                    MusicPlay.PlayMusic($"{Environment.CurrentDirectory}\\Voice\\签到成功，请取走您的凭条.mp3");
                    BackgroundImage = Properties.Resources.isprinting;
                    break;
                case Enums.ShowStatus.IsRepeat:
                    MusicPlay.PlayMusic($"{Environment.CurrentDirectory}\\Voice\\不能重复签到，请按提示就诊.mp3");
                    BackgroundImage = Properties.Resources.isrepeat;
                    break;
                case Enums.ShowStatus.NoPaper:
                    BackgroundImage = Properties.Resources.nopaper;
                    break;
                case Enums.ShowStatus.NoSignInfo:
                    MusicPlay.PlayMusic($"{Environment.CurrentDirectory}\\Voice\\没有您的信息，如有疑问请咨询工作人员.mp3");
                    BackgroundImage = Properties.Resources.nopaper;
                    break;
            }


            lab_PatName.Text = signInfo.PatientName;
            lab_PosName.Text = signInfo.OfficePs;
            lab_DocName.Text = signInfo.DoctorName;
            lab_OfficeName.Text = signInfo.OfficeName;
            lab_Status.Text = signInfo.SignStatusDesc;
            lab_SignTime.Text = signInfo.SignTime;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            lab_time.Text = DateTime.Now.ToString("HH:mm:ss");
            if (_remainTimes <= 0)
            {
                Close();
            }

            _remainTimes--;
        }

        private void ShowInfo_Load(object sender, EventArgs e)
        {
            //设置宽高
            Height = 1920;
            Width = 1080;
        }
    }
}